import React from 'react';
import ReactDOM from 'react-dom';
import { Child1, Child2 } from './child1'
/* 
  凡是在组件上添加的事件或者属性 都是自定义的

*/
class App extends React.Component {

  state = {
    name: "珠峰"
  }
  changeName(name) {
    this.setState({
      name
    })
  }
  render() {
    let { name } = this.state;
    return <div className=''>
      <Child1 data={name} onChange={this.changeName.bind(this)} />
      <Child2 data={name} onChange={this.changeName.bind(this)} />
    </div>;
  }
}

ReactDOM.render(<App />, document.getElementById('root'))